﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;

namespace Young3.FMSearch.Core.Entities.InGame
{
    public static partial class PositionalRatings
    {
        private static Func<PlayerSkills, decimal> __gkRatings = null;
        public static Func<PlayerSkills, decimal> GKRatings
        {
            get
            {
                if (__gkRatings == null)
                {
                    __gkRatings = (p) =>
                        (Convert.ToDecimal(
                        p.Anticipation * 10 +
                        p.Bravery * 40 +
                        p.Anticipation * 10 +
                        p.Bravery * 40 +
                        p.Composure * 10 +
                        p.Concentration * 40 +
                        p.Decisions * 20 +
                        p.Influence * 20 +
                        p.Positioning * 80 +
                        p.Teamwork * 20 +

                        p.Acceleration * 20 +
                        p.Agility * 40 +
                        p.Balance * 10 +
                        p.Jumping * 60 +
                        p.NaturalFitness * 10 +
                        p.Strength * 20 +

                        p.AerialAbility * 40 +
                        p.CommandOfArea * 40 +
                        p.Communication * 60 +
                        p.Eccentricity * -20 +
                        p.Handling * 100 +
                        p.OneOnOnes * 40 +
                        p.Reflexes * 100)
                        / Convert.ToDecimal((10+40+10+40+10+40+20+20+80+20+20+40+10+60+10+20+40+40+60+-20+100+40+100) * 100));
                }
                return __gkRatings;
            }
        }
    }
}
